<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head th:include="common_include :: commonHead('组别编辑')"/>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="ibox float-e-margins">
        <div class="ibox-content">
            <form class="form-horizontal m" id="form-group-edit" th:object="${group}">
                <input type="hidden" name="rowKey" id="rowKey" th:field="*{rowKey}"/>
                <input type="hidden" name="serverKey" id="serverKey" th:field="*{serverKey}"/>
                <div class="form-group">
                    <label class="col-sm-3 control-label">组别名称：</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="text" name="groupName" id="groupName" readonly="true" th:field="*{groupName}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label ">组别描述：</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="text" name="groupDesc" id="groupDesc" th:field="*{groupDesc}"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label ">组员列表：</label>
                    <div class="col-sm-8">
                        <select multiple="true" id="usernames" name="usernames" class="form-control m-b">
                            <option th:each="user:${allUsers}"
                                    th:value="${user.username}"
                                    th:text="${user.username + '(' + user.staffNum + '-' + user.staffName + ')'}"
                                    th:selected="${groupUsers.contains(user.username)}"></option>
                        </select>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<div th:include="common_include :: commonFoot"/>
<script type="text/javascript">
    var prefix = ctx + "service/svnkit/groups"

    $("#form-group-edit").validate({
        submitHandler: function (form) {
            $.operate.save(prefix + "/edit", $('#form-group-edit').serialize());
        }
    });

    function submitClick() {
        if ($('#form-group-edit').valid()) {
            $('#form-group-edit').submit()
        }
    }
</script>
</body>
</html>
